package com.estate.dao.impl;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.SessionFactory;

import com.estate.dao.ManageProjectDao;
import com.estate.vo.Vo;
import com.estate.vo.impl.ManageProjectVo;
import com.estate.vo.impl.PriceProjectVo;

public class ManageProjectImpl implements ManageProjectDao {
	
	private SessionFactory sessionFactory;
	
	public SessionFactory getSessionFactory(){
		return this.sessionFactory;
	}
	
	public void setSessionFactory(SessionFactory sessionFactory){
		this.sessionFactory=sessionFactory;
	}

	public boolean addVo(Vo vo) {
		// TODO Auto-generated method stub
		this.getSessionFactory().getCurrentSession().save(vo);
		return false;
	}

	public boolean deleteVo(Vo vo) {
		// TODO Auto-generated method stub
		this.getSessionFactory().getCurrentSession().delete(vo);
		return false;
	}

	public List<Vo> findAll() {
		// TODO Auto-generated method stub
		Query query=this.getSessionFactory().getCurrentSession().createQuery("from ManageProjectVo");
		List<Vo> voList=query.list();
		return voList;
	}

	public Vo findByPK(Object pk) {
		// TODO Auto-generated method stub
		Vo vo=(Vo)this.getSessionFactory().getCurrentSession().get(ManageProjectVo.class, (Integer)pk);
		return vo;
	}

	public boolean updateVo(Vo vo) {
		// TODO Auto-generated method stub
		this.getSessionFactory().getCurrentSession().update(vo);
		return false;
	}

	public List<Vo> findByRecordUserId(int recordUserId) {
		// TODO Auto-generated method stub
		return null;
	}

	public List<Vo> findByState(int state) {
		// TODO Auto-generated method stub
		return null;
	}

}
